<div class="container">
	<ul class="nav nav-tabs">
		<li {{if $current_controller=='orders' && $current_action=='mine'}}class="active"{{/if}}><?php echo $this->Html->link('我的订单', array('controller' => 'orders','action'=>'mine','plugin' => null ,)); ?></li>
        <li {{if $current_action=='business'}}class="active"{{/if}}><?php echo $this->Html->link('商家订单', array('controller' => 'orders','action'=>'business','plugin' => null ,)); ?></li>
        <li {{if $current_controller=='products' && $current_action=='mine'}}class="active"{{/if}}><?php echo $this->Html->link('我的商品', array('controller' => 'products','action'=>'mine','plugin' => null ,)); ?></li>
	</ul>
		
    <table class="table table-striped table-hover">
    <?php
        $tableHeaders =  $this->Html->tableHeaders(array(
			'图片',
            '名称',
            '价格',
			'是否上架',
            '操作',
        ));

        echo '<thead>'.$tableHeaders.'</thead>';

        $rows = array();
        foreach ($datalist AS $item) {
            $actions = ' ' . $this->Html->link('修改', array('controller'=>'products','action' => 'edit', $item['Product']['id']));
			
            $rows[] = array(
                $this->Html->image(
		$this->Html->url($item['Product']['coverimg']),
array('style'=>'max-width:100px;max-height:100px;')),
                $item['Product']['name'],
				$item['Product']['price'],
				$item['Product']['published'],
                $actions,
            );
        }
        echo $this->Html->tableCells($rows);

		echo '<thead>'.$tableHeaders.'</thead>';
    ?>
    </table>
    {{$page_navi}}
</div>